package com.css.dzj.dzjdzqs.modules.apinventory.controller;

import com.css.dzj.dzjdzqs.common.util.R;
import com.css.dzj.dzjdzqs.modules.apinventory.entity.JgInventoryEntity;
import com.css.dzj.dzjdzqs.modules.apinventory.service.ApInventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author WT
 * @Date 2020/7/2
 */
@RestController
@RequestMapping("/apInvent")
public class ApInventController {

    @Autowired
    private ApInventService apInventService;

    @GetMapping("/info")
    public R info(@RequestParam String recordProjectAddress){
        try {
            JgInventoryEntity jgInventoryEntity = apInventService.findByAddress(recordProjectAddress);
            return R.ok().put("data", jgInventoryEntity);
        } catch (Exception e) {
            e.printStackTrace();
            return R.error(e.getMessage());
        }

    }


}
